<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>掌上农贸市场</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=yes" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <link href="<%=basepath%>css/index-1.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
    <script src="<%=basepath%>js/TouchSlide.1.1.js"></script>
</head>
<body>
<%
String code = request.getParameter("code");
String state =request.getParameter("state");
String remsg =request.getParameter("remsg");
%>
<div class="viewport">
    <div class="header">
        <div class="header-1">
            <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=mine&prefix=3g_mine" id="join" class="header-2">
                <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="compNickName" class="compNickName">${user.companyNickName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
            </a>
            <a href="javascript:void(0)" id="logRegister" class="header-3">登 录</a>
        </div>
    </div>
    <div class="content m-top">
        <div class="content-1">
            <div id="slideBox" class="slideBox">
                <div class="bd">
                    <ul>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a1.jpg" /></a>
                            <a class="tit" href="javascript:void(0)">中国农商产业领跑者</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a2.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">惠农惠民，便民服务</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a7.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">生鲜配送</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a4.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">有机农产品定制</a>
                        </li>
                    </ul>
                </div>
                <div class="hd">
                    <ul></ul>
                </div>
                <script type="text/javascript">
                    TouchSlide({
                        slideCell:"#slideBox",
                        titCell:".hd ul",
                        mainCell:".bd ul",
                        effect:"leftLoop",
                        autoPage:true,
                        autoPlay:true
                    });
                </script>
            </div>
        </div>
        <div class="blank"></div>
        <div class="content-2">
            <div class="content-2-1">
                <p>以城市一级农批市场为枢纽，覆盖其他各级农贸市场经营户；面向农产品流通领域中各类型购销商；上游种植户、合作社；下游餐饮、商超采购商提供的专业B2B购销平台。</p>
            </div>
        </div>
        <div class="blank"></div>
        <div class="content-7">
            <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=purchasing&prefix=3g_purchasing" class="content-7-1">
                <div class="blank-1"></div>
                <div class="content-7-3"><span class="span-index1 text-shadow">采购通</span></div>
                <div class="content-7-4"><span class="span-index2 text-shadow">您的专业采购助理、简易便捷的移动进、销、存系统。</span></div>
            </a>
            <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=business&prefix=3g_business" class="content-7-2">
                <div class="blank-1"></div>
                <div class="content-7-3"><span class="span-index1 text-shadow">经销易</span></div>
                <div class="content-7-4"><span class="span-index2 text-shadow">您的专业采购助理、简易便捷的移动进、销、存系统。</span></div>
            </a>
        </div>
        <div class="blank"></div>
        <div class="content-3">
            <div class="content-3-1">
                <a class="content-3-1-1" href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=agribusiness&prefix=3g_bank">
                    <span class="span-1">广发银行</span><span class="span-2">农商一卡通</span><img src="<%=basepath%>images/b81.png">
                </a>
            </div>
            <div class="blank"></div>
            <div class="content-3-3">
                <img src="<%=basepath%>images/b18.png">
            </div>
        </div>
        <div class="content-6">
            <div class="content-6-1"><a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes"><span><b>粤西农批</b>&nbsp;&nbsp;&nbsp;季节性临时收费管理</span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=store&prefix=3g_platform_shop-rent_op"><span><b>粤西农批</b>&nbsp;&nbsp;&nbsp;场内出租商铺管理</span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=cold-storage-inquire&prefix=3g_platform_cold-storage_op"><span><b>粤西农批</b>&nbsp;&nbsp;&nbsp;冷库管理</span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="javascript:void(0)"><span>广发银行、粤西农批【租约贷】申请与使用手册 </span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="<%=basepath%>3g/guide.html"><span>粤西农批美食广场盛大揭幕</span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="<%=basepath%>3g/guide.html"><span>粤西农批专业海鲜批发市场盛大开业</span><img src="<%=basepath%>images/b81.png"></a> </div>
            <div class="content-6-1"><a href="http://www.accedeal.com/wape-web/bills/bills.html"><span>更多………</span><img src="<%=basepath%>images/b81.png"></a> </div>
        </div>
        <div class="content-5"><span>版权：武汉快来网络科技有限公司</span><img src="<%=basepath%>images/top.png" id="top" class="top"></div>
    </div>
</div>
</body>
<script type="text/javascript">
    /*错误提示*/
    $(function(){
        var error = "${requestScope.returnMsg}";
        if(error != "" && error != "成功!"){
            layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        }
    });
    /*浏览器识别*/
    $(function(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            /*自动登录*/
            layer.load();
            /*微信 */
            $.ajax({
                url:"/wape-web/api/core/centerService",
                dataType:"json",
                data:{
                    serviceCode:"1001W01",
                    code:"<%=code %>"
                },
                complete:function(xhr,status){
                	var openId = xhr.responseText.replace(/(\n)+|(\r\n)+/g, "");
                    //alert(openId);
                    if(openId == "null" || openId == ""){
                    	layer.closeAll();
                    	window.location.href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=w-index&prefix=we&entrance=yes";
                    }
                    else{
                    	$.ajax({
                            type:"post",
                            url:"/wape-web/api/core/centerService",
                            data:{
                                serviceCode:"1001W02",
                                sign: 'web',
                                timestamp: 'web',
                                nonce: 'web',
                                editUser: 'web',
                                editTime: 'web',
                                device: 'web',
                                ipaddr: 'web',
                                mac: 'web',
                                openId:openId
                            },
                            success:function(data){
                                var wechat = eval("("+data+")");
                                if(wechat.returnCode == "200"){
                                    layer.closeAll();
                                    $("#logRegister").hide();
                                    if(wechat.result.realName != ""){
                                        $("#account").text(wechat.result.realName);
                                    }
                                    else if(wechat.result.realName == ""){
                                        $("#account").text("您还未登录哦！");
                                    }
                                    $("#compNickName").text(wechat.result.companyNickName);
                                    $("#deptName").text(wechat.result.departmentName)
                                }
                                else{
                                    layer.closeAll();
                                    var loginPath = "/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=w-login&prefix=we&openId=" + openId + "&isWX=yes" 
                                    $("#logRegister").attr("href",loginPath);
                                    $("#account").text("您还未登录哦！");
                                    layer.msg("您未绑定农商号，请登录绑定！",{shadeClose:true,shade:0.1,time:2000});
                                }
                            }
                        })
                    }
                    
                }
            });
        }
        else{}
    });
    /*返回顶部 */
    $(function(){
        $("#top").click(function(){
            $("html,body").animate({scrollTop:0},"slow");
        });
    });
</script>
</html>

